package cn.app.android.sichuanxiaoke.com.xiaokeapp.activity;

import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import java.util.ArrayList;
import java.util.List;

import cn.app.android.sichuanxiaoke.com.xiaokeapp.BaseActivity.BaseActivity;
import cn.app.android.sichuanxiaoke.com.xiaokeapp.R;
import cn.app.android.sichuanxiaoke.com.xiaokeapp.adapter.MyAdapter_shopshow;
import cn.app.android.sichuanxiaoke.com.xiaokeapp.fragment.Shop_Show_Fragment1;
import cn.app.android.sichuanxiaoke.com.xiaokeapp.fragment.Shop_Show_Fragment2;

/**
 * 商品展示页
 */

public class Shopping_Show_Activity extends BaseActivity {
    private TabLayout tabLayout;
    private ViewPager viewPager;

    private List<Fragment> list;
    private MyAdapter_shopshow adapter;
    private String[] titles = {"商品", "视屏购物"};
    @Override
    public void getview() {
        setContentView(R.layout.shopping_show_activity);
    }

    @Override
    public void initview() {
        viewPager = (ViewPager) findViewById(R.id.viewpager);
        tabLayout = (TabLayout) findViewById(R.id.tablayout);
        list = new ArrayList<>();
        list.add(new Shop_Show_Fragment1());
        list.add(new Shop_Show_Fragment2());
        adapter = new MyAdapter_shopshow(getSupportFragmentManager(),list,titles);
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
    }
}
